package com.example.chapter11;



/**
 * 11.2.3.函数式接口
 */
public class Demo03 {


    @FunctionalInterface
    public interface MyFunctionalInterface {
        void singleAbstractMethod();

        default void defaultMethod() {
            System.out.println("This is a default method.");
        }
    }

    public static void main(String[] args) {
        MyFunctionalInterface myLambda = () -> System.out.println("Hello, lambda!");
        myLambda.singleAbstractMethod();
        // 输出 "Hello, lambda!"
    }
}
